<?php 

include_once("./includes/config.inc.php");

//get the banners
$q1 = "select * from PHPAUCTION_banners order by rand() limit 0,1";
$r1 = mysql_query($q1) or die(mysql_error());

$b = mysql_num_rows($r1);

if($b < '1')
{
	for($bb = '1'; $bb <= (1 - $b); $bb++)
	{
		$banners .= "<center><a href=\"advertise.php\"><img src=\"images/banner.gif\" border=1 style=\"border-color:D3D4E8\"></a></center>\n\t";
	}
}

while($a1 = mysql_fetch_array($r1))
{
	$banners .= "<center><a href=\"$a1[BannerURL]\" target=_blank><img src=\"banners/$a1[BannerFile]\" border=0></a></center>\n\t";
}

//$banners .= "\n\n";


?>